

    \filetitle{movavg}{Moving geometric average pseudofunction}{modellang/movgeom}

	\paragraph{Syntax}

\begin{verbatim}
movgeom(Expr)
movgeom(Expr,K)
\end{verbatim}

\paragraph{Description}

If the second input argument, \texttt{K}, is negative, this function
expands to the moving geometric average of the last K periods (including
the current period), i.e.

\begin{verbatim}
(((Expr)*(Expr{-1})* ... *(Expr{-(K-1)})^(1/-K))
\end{verbatim}

where \texttt{Expr\{-N\}} derives from \texttt{Expr} and has all its
time subscripts shifted by \texttt{-N} (if specified).

If the second input argument, \texttt{K}, is positive, this function
expands to the moving geometric average of the next K periods ahead
(including the current period), i.e.

\begin{verbatim}
(((Expr)*(Expr{1})* ... *(Expr{K-1})^(1/K))
\end{verbatim}

If the second input argument, \texttt{K}, is not specified, the default
value -4 is used (based on the fact that most of the macroeconomic
models are quarterly).

\paragraph{Example}

The following three lines

\begin{verbatim}
movgeom(Z)
movgeom(Z,-3)
movgeom(X+Y{-1},2)
\end{verbatim}

will expand to

\begin{verbatim}
(((Z)*(Z{-1})*(Z{-2})*(Z{-3}))^(1/4))
(((Z)*(Z{-1})*(Z{-2}))^(1/3))
(((X+Y{-1})*(X{1}+Y))^(1/2))
\end{verbatim}


